package com.asimasoft.cncRouter;

import org.eclipse.jface.action.ICoolBarManager;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.part.EditorActionBarContributor;

public class VistaPreviaEditorContributor extends EditorActionBarContributor {

	private ZoomEditorAction zoomInAction;
	private ZoomEditorAction zoomOutAction;
	
	public VistaPreviaEditorContributor() {
		
		zoomInAction = new ZoomEditorAction("ZoomIn",ZoomEditorAction.ZOOM_IN);
		zoomOutAction = new ZoomEditorAction("ZoomOut",ZoomEditorAction.ZOOM_OUT);
		
		System.out.println("Creado contributor");
		
	}

	@Override
	public void contributeToCoolBar(ICoolBarManager coolBarManager) {
		super.contributeToCoolBar(coolBarManager);
		
		coolBarManager.add(new Separator("CNCPreviewEditor"));
		coolBarManager.add(zoomInAction);
		System.out.println("Agregado al coolBar");
		
	}

	@Override
	public void contributeToMenu(IMenuManager menuManager) {
		// TODO Auto-generated method stub
		super.contributeToMenu(menuManager);
	}

	@Override
	public void contributeToStatusLine(IStatusLineManager statusLineManager) {
		// TODO Auto-generated method stub
		super.contributeToStatusLine(statusLineManager);
	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub
		super.dispose();
	}

	@Override
	public void init(IActionBars bars) {
		// TODO Auto-generated method stub
		super.init(bars);
	}

	@Override
	public void setActiveEditor(IEditorPart targetEditor) {
		super.setActiveEditor(targetEditor);
		zoomInAction.setActiveEditor(targetEditor);
	}
}
